package com.qidian.common;

import java.util.concurrent.atomic.AtomicLong;


public final class IDGenerator
{
	
	
    public AtomicLong id_seq  ;
    public int step = 1;
    
    public IDGenerator(long init, int step)
    {
        id_seq = new AtomicLong(init) ;
        this.step = step ;
    }
    
    public long getNextId()
    {
        return id_seq.addAndGet(step) ;
    }
    
    public long getCurrentId()
    {
        return id_seq.get() ;
    }
}
